using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Helper;
namespace CoreData
{
    public class Stock_VoicherInDetail
    {
            public int ID{get;set;}
            public int Stock_VoucherInID{get;set;}
            public int ProductID{get;set;}
            public int Quantity{get;set;}
            public Decimal Price{get;set;}
            public Decimal Amount{get;set;}
            public int UnitID{get;set;}
         
        public Stock_VoicherInDetail()
        {       
        }
        
       static Stock_VoicherInDetail DynamicCast<T>(object row_data, object row_header) where T : Stock_VoicherInDetail
       {
           // row_data : DataRow
           // row_header : DataColumnCollection
           Stock_VoicherInDetail ret = new Stock_VoicherInDetail();
           DataRow dt = (DataRow)row_data;

           foreach (DataColumn column in (DataColumnCollection)row_header)
           {
               switch (column.ColumnName)
               {
                      case  "ID":
                        ret.ID = ConvertObject.ToInt(dt[column]);
                       break;
                      case  "Stock_VoucherInID":
                        ret.Stock_VoucherInID = ConvertObject.ToInt(dt[column]);
                       break;
                      case  "ProductID":
                        ret.ProductID = ConvertObject.ToInt(dt[column]);
                       break;
                      case  "Quantity":
                        ret.Quantity = ConvertObject.ToInt(dt[column]);
                       break;
                      case  "UnitID":
                        ret.UnitID = ConvertObject.ToInt(dt[column]);
                       break;
                
                   default:
                       break;
               }
           }

           return ret;
       }
        
    }
}
